﻿using System.Configuration;

namespace Eswat.Configuration
{
	/// <summary>
	/// Configuration section for the root ESWAT configuration.
	/// </summary>
	public class EswatConfiguration : ConfigurationSection
	{
		private const string servicesKey = "services";

		private const string testResultsLoggingServiceTypeKey = "loggingServiceType";

		private const string testResultsLoggingServiceTypeDefault = "Eswat.TestResultAggregator, Eswat";

		/// <summary>
		/// Initializes a new instance of the <see cref="EswatConfiguration"/> class.
		/// </summary>
		public EswatConfiguration()
			: base()
		{
		}

		/// <summary>
		/// Gets the services.
		/// </summary>
		[ConfigurationProperty(servicesKey, IsDefaultCollection = false)]
		public ServicesCollection Services
		{
			get { return (ServicesCollection)base[servicesKey]; }
		}

		/// <summary>
		/// Gets or sets the type of the test results logging.
		/// </summary>
		/// <value>
		/// The type of the test results logging.
		/// </value>
		[ConfigurationProperty(testResultsLoggingServiceTypeKey,
			DefaultValue = testResultsLoggingServiceTypeDefault,
			IsRequired = false)]
		public string TestResultsLoggingType
		{
			get { return (string)base[testResultsLoggingServiceTypeKey]; }

			set { base[testResultsLoggingServiceTypeKey] = value; }
		}
	}
}
